import request from '_c/utils/request'



/**
 * 查询代理商终端列表
 */
export function merchBindTermList(data) {
	return request({
//		url: '/api/ag/merchBindTerm/list',
		url: '/api/ag/term/list',
		method: 'GET',
		params: data
	})
}

// 查询终端可修改的服务费列表
export function canChangeRateList(query) {
	return request({
		url: '/api/ag/change/serviceFee/query',
		method: 'get',
		params: query
	})
}

//申请修改终端服务费
export function changeRateApply(data) {
	return request({
//		url: '/api/ag/change/merch/rate/detail/apply',
		url: '/api/ag/term/operate/modifyAtes',
		method: 'post',
		data,
		noShowMsg:true
	})
}


// 修改服务费列表记录
export function changeRateHistory(query) {
	return request({
		url: '/api/ag/change/merch/rate/detail/list',
		method: 'get',
		params: query
	})
}

/** 通过终端品牌编码查找支持的费率类型 **/
export function canChangeRateType(query) {
	return request({
		url: '/api/ag/change/merch/rate/map/byBrandCode',
		method: 'get',
		params: query
	})
}

/** 获取费率组 **/
export function changeMerchRateGroupList(query) {
	return request({
		url: '/api/ag/change/merch/rate/map/list',
		method: 'get',
		params: query
	})
}

// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
  return request({
    url: '/system/dict/data/type/' + dictType,
    method: 'get'
  })
}
//品牌列表
/** 列表 **/
export function brandList(query) {
  return request({
    url: '/api/ag/term/brand/list',
    method: 'get',
    params: query
  })
}
/** 获取代理商或服务商列表 **/
export function agentList(query) {
  return request({
    url: '/api/ag/agent/info/list',
    method: 'get',
    params: query
  })
}

// 根据id查询终端信息
export function getCtTermById(id) {
  return request({
    url: '/api/ag/term/termInfo/' + id,
    method: 'get'
  })
}

//查询配置费率范围
export function queryFeeRange(dictType) {
  return request({
    url: `/api/ag/agent/info/query/agentFeeRange/${dictType}`,
    method: 'get'
  })
}

//查询费率配置，判断是否有权限修改费率
export function queryLoginFeeRange(dictType) {
  return request({
    url: `/api/ag/agent/info/query/loginFeeRange/${dictType}`,
    method: 'get'
  })
}